package net.lijingye.education.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import net.lijingye.education.entity.User;
import net.lijingye.education.util.CommonUtil;

import java.util.Date;

/**
 * Created by LijingYe on 2016/3/26.
 */
public class MyProfileVO {
    @JSONField(name = "id", ordinal = 0, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String id;
    @JSONField(name = "name", ordinal = 1, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String name;
    @JSONField(name = "gender", ordinal = 2, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String gender;
    @JSONField(name = "depart", ordinal = 3, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String depart;
    @JSONField(name = "faceIcon", ordinal = 4, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String faceIcon;
    @JSONField(name = "birthday", ordinal = 5, serialzeFeatures = SerializerFeature.WriteMapNullValue, format = "yyyy/MM/dd")
    private Date birthday;
    @JSONField(name = "telephone", ordinal = 6, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String telephone;
    @JSONField(name = "email", ordinal = 7, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String email;
    @JSONField(name = "home", ordinal = 8, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String home;
    @JSONField(name = "hobbies", ordinal = 9, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String hobbies;
    @JSONField(name = "motto", ordinal = 10, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String motto;

    public MyProfileVO(User user) {
        this.id = user.getId();
        this.name = CommonUtil.getUserDisplayName(user);
        this.gender = CommonUtil.getUserGenderText(user);
        this.depart = user.getDepart().getName();
        this.faceIcon = user.getFaceIcon();
        this.birthday = user.getBirthday();
        this.telephone = user.getTelephone();
        this.email = user.getEmail();
        this.home = CommonUtil.getUserHomeText(user);
        this.hobbies = user.getHobbies();
        this.motto = user.getMotto();
    }

    public MyProfileVO(String id, String name, String gender, String depart, String faceIcon, Date birthday, String telephone, String email, String home, String hobbies, String motto) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.depart = depart;
        this.faceIcon = faceIcon;
        this.birthday = birthday;
        this.telephone = telephone;
        this.email = email;
        this.home = home;
        this.hobbies = hobbies;
        this.motto = motto;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getDepart() {
        return depart;
    }

    public void setDepart(String depart) {
        this.depart = depart;
    }

    public String getFaceIcon() {
        return faceIcon;
    }

    public void setFaceIcon(String faceIcon) {
        this.faceIcon = faceIcon;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getHome() {
        return home;
    }

    public void setHome(String home) {
        this.home = home;
    }

    public String getHobbies() {
        return hobbies;
    }

    public void setHobbies(String hobbies) {
        this.hobbies = hobbies;
    }

    public String getMotto() {
        return motto;
    }

    public void setMotto(String motto) {
        this.motto = motto;
    }

    @Override
    public String toString() {
        return "MyProfileVO{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", depart='" + depart + '\'' +
                ", faceIcon='" + faceIcon + '\'' +
                ", birthday=" + birthday +
                ", telephone='" + telephone + '\'' +
                ", email='" + email + '\'' +
                ", home='" + home + '\'' +
                ", hobbies='" + hobbies + '\'' +
                ", motto='" + motto + '\'' +
                '}';
    }
}
